<div class="title-name">
	<h2>Tạo ứng dụng mới</h2>
</div>
<?php if(!empty($this->result)){?>
<?php if($this->result['status']==0){?>

<div class="alert alert-danger" role="alert">
	<ul>
        <?php foreach ($this->result['message'] as $r){?>
        <li><?php echo $r?></li>
        <?php }?>
    </ul>
</div>
<?php }?>
<?php }?>
<div>
	<ul id="tab-add-app" class="ifs-tabbar">
		<li class="complete">
			<div class="ifs-tab-nav">
				<a href="#name-app">Khai báo ứng dụng</a>
			</div>
		</li>
		<li class="complete">
			<div class="ifs-tab-nav">
				<a>Chọn loại ứng dụng</a>
			</div>
		</li>
		<li class="active">
			<div class="ifs-tab-nav">
				<a>Thông tin mô tả</a>
			</div>
		</li>
		<li>
			<div class="ifs-tab-nav">
				<a>Chọn thiết bị</a>
			</div>
		</li>
		<li>
			<div class="ifs-tab-nav">
				<a>Liên hệ</a>
			</div>
		</li>
	</ul>
</div>
	<fieldset class="ifs_tab_cell">
		<legend>Bước 3: Thông tin mô tả</legend>
		<div class="tab-content-cell">
		  <form enctype="multipart/form-data" action="<?php echo _BASE_URL.'/developer/app/iconadd'?>" method="post" id="icon-form" class="form-horizontal">
			<div class="form-group">
				<label for="name-app" class="col-xs-3 control-label">Icon ứng dụng</label>
				<div class="col-xs-5">
					<table style="width: 100%">
						<tr>
							<td>
								<div style="text-align: center; margin-bottom: 8px;">
									<img id="icon_view"
										src="<?php echo TEMPLATE_URL?>/assets/images/no-icon.png"
										width="200" height="200" alt="your image" />
								</div>
								<div id="progress-icon" class="progress" style="display: none;">
                                  <div id="progress-bar-icon" class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
                                    <span id='percent-icon'></span>
                                  </div>
                                </div>
                                <div id='result-icon'></div>
							</td>
						</tr>
						<tr>
							<td>
								<input type="file" id="icon_app" name="icon_app">
								<input type="hidden" name="id_app" value="<?php echo $this->app_id;?>">
							</td>
							<td>
							     <div class="fileUpload btn btn-primary btn-xs">
									<span>Tải lên</span> <input type="submit"
										class="upload screenshot" name="upicon" value="1">
								</div>
							</td>
						</tr>
						
						
					</table>

				</div>
				<div class="col-xs-4">
					<b>Icon ứng dụng</b><br>
					<p class="help-block">
						<span>200 x 200</span><br> <span>32 bit PNG or JPG</span><br> <span>Lớn
							nhất 1024KB</span>
					</p>
				</div>
			</div>
			</form>
			<form enctype="multipart/form-data" action="<?php echo _BASE_URL.'/developer/app/screenadd'?>" method="post" id="screenshot" class="form-horizontal">
			<div class="form-group">
				<label for="screenshot" class="col-xs-3 control-label">Ảnh
					screenshot<br> <span class="help-block-1">ít nhất 3</span>
				</label>
				<div class="col-xs-5">

					<table style="width: 100%" id="table-screen">
						<tr>
							<td>
								<input type="file" id="screen_app" name="screen_app">
								<input type="hidden" name="id_app" value="<?php echo $this->app_id;?>">
							</td>
							<td>
							     <div id="doupscreen" class="fileUpload btn btn-primary btn-xs">
									<span>Tải lên</span> <input type="submit"
										class="upload screenshot" name="upscreen" value="1">
								</div>
							</td>
						</tr>
						<tr>
						  <td>
						      <div id="progress-screen" class="progress" style="display: none;">
                                  <div id="progress-bar-screen" class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
                                    <span id='percent-screen'></span>
                                  </div>
                                </div>
                                <div id='result-screen'></div>
						  </td>
						</tr>
						<tr>
						  <td>
						      <ul id = "view_screenshot">
						          
						      </ul>
						  </td>
						</tr>

					</table>

				</div>
				<div class="col-xs-4">
					<b>Ảnh screenshot</b>
					<p class="help-block">1136x640, 640x1136, 1024x768, 768x1024,
						960x640, 640x960, 480x800, 320x480, 320x240, 240x320 24 bit PNG or
						JPG</p>
				</div>

			</div>
			</form>
			<form enctype="multipart/form-data" action="" method="post" id="add-new-app-next" class="form-horizontal">
			<div class="form-group">
				<label for="name-app" class="col-xs-3 control-label">Video giới
					thiệu<br> <span class="help-block-1">Tùy chọn</span>
				</label>
				<div class="col-xs-5">
					<p class="help-block">Thêm đường dẩn tới video giới thiệu</p>
					<input type="text" class="form-control" name="video_app"
						placeholder="https://www.youtube.com/watch?v=ID">
				</div>
				<div class="col-xs-4">
					<b>Icon ứng dụng</b><br>
					<p class="help-block">
						<span>Nhập đường dẫn YouTube</span><br> <span>VD.
							https://www.youtube.com/watch?v=ID</span>
					</p>
				</div>
			</div>
			<div class="form-group">
				<label for="name-app" class="col-xs-3 control-label">Tags</label>
				<div class="col-xs-5">
					<textarea class="form-control" rows="3" id="tags_new" name="tags"></textarea>
				</div>
				<div class="col-xs-4">
					<b>Tags</b><br>
					<p class="help-block">Mổi tag cách nhau bởi dấu ","</p>
				</div>
			</div>
			<div class="form-group">
				<label for="name-app" class="col-xs-3 control-label">Mô tả ngắn</label>
				<div class="col-xs-9">
					<textarea class="form-control tinymce" rows="3" id="des_short_new"
						name="des_short"></textarea>
					<p class="help-block">Tối đa 200 ký tự</p>
				</div>

			</div>
			<div class="form-group">
				<label for="name-app" class="col-xs-3 control-label">Mô tả</label>
				<div class="col-xs-9">
					<textarea class="form-control tinymce" rows="5" id="description_new"
						name="description"></textarea>
				</div>

			</div>
			<div class="form-group">
        		<div class="col-xs-6 col-xs-offset-3">
        			<input class="btn btn-default" type="reset" id="cancle-app"
        				value="Hủy bỏ"> <input class="btn btn-success" type="submit" value="Bước tiếp theo">
        		</div>
        	</div>
			</form>
		</div>
	</fieldset>
	
	<div class="clearfix"></div>
	
<script type="text/javascript">
	$(function () {
		
		tinymce.init({
			fullpage_default_encoding: "UTF-8",
			menubar : false,
			entity_encoding : "raw",
			selector: "textarea#des_short_new",
			schema: "html5",
			toolbar: "bold italic | alignleft aligncenter alignright alignjustify",
			setup: function (editor) {
			    editor.on('keyup', function (e) {
			        $('#add-new-app-next').bootstrapValidator('revalidateField', 'des_short');
			    });
    		}
		});
		tinymce.init({
			fullpage_default_encoding: "UTF-8",
			menubar : false,
			entity_encoding : "raw",
			selector: "textarea#description_new",
			schema: "html5",
			toolbar: "bold italic | alignleft aligncenter alignright alignjustify",
			setup: function (editor) {
			    editor.on('keyup', function (e) {
			        $('#add-new-app-next').bootstrapValidator('revalidateField', 'description');
                });
    		}
		});
		
	});
</script>